<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<ui:composition>
	<div style="margin: 0; padding: 0; position: relative;">
		<h:form id="formEsquerdo">
			<div style="display: table;">
				<div align="left"
					style="padding-top: 20px; padding-left: 15px; display: table-cell;">
					<h:outputLink value="perfil.jsf?user=#{sessaoBean.usuario.id}">
						<p:graphicImage id="fotoH" height="50" style="background: white"
							rendered="#{sessaoBean.usuario.genero eq 'MASCULINO'}"
							url="/resources/img/homem.png" />
						<p:graphicImage id="fotoM" height="50"
							rendered="#{sessaoBean.usuario.genero eq 'FEMININO'}"
							url="/resources/img/mulher.png" />
					</h:outputLink>
				</div>
				<div
					style="display: table-cell; padding-top: 20px; padding-left: 10px; vertical-align: top;">
					<h:outputLink styleClass="labelPequeno"
						style="text-decoration: none;"
						value="perfil.jsf?user=#{sessaoBean.usuario.id}">
						<b>#{sessaoBean.usuario.nome}</b>
					</h:outputLink>
					<br />
					<h:outputLink styleClass="labelPequeno"
						style="text-decoration: none;"
						value="perfil.jsf?user=#{sessaoBean.usuario.id}">
						Editar meu perfil
					</h:outputLink>
				</div>
			</div>
			<br />
			<p:commandButton style="width: 100%; border: none;"
				value="Atualizações" action="index" />
			<p:commandButton style="width: 100%; border: none;" 
				value="Pesquisar" action="busca" />
			<br />
			<br />
			<p:commandButton style="width: 100%; border: none;" value="Sair"
				action="#{sessaoBean.logout}" />
			<p:commandButton 
				id="botaoNovosConselhos"
				style="width: 100%; border: none; color: red;" 
				value="Você recebeu conselhos!"
				action="#{sessaoBean.visualizarNovosConselhos}" 
				rendered="#{sessaoBean.usuario.novosConselhos}">
				<f:setPropertyActionListener
					value="#{sessaoBean}"
					target="#{sessaoBean}" />
			</p:commandButton>
			<p:poll 
				interval="5"
				listener="#{sessaoBean.verificar}"
            	update="formEsquerdo" />

			<p:commandButton 
				id="botaoNovidadesNosRelatos"
				style="width: 100%; border: none; color: red;" 
				value="Novidades em relatos que você segue!"
				action="#{sessaoBean.visualizarNovidadesNosRelatos}" 
				rendered="#{sessaoBean.usuario.novidadesNosRelatos}">
				<f:setPropertyActionListener
					value="#{sessaoBean}"
					target="#{sessaoBean}" />
			</p:commandButton>
			<p:poll 
				interval="5"
				listener="#{sessaoBean.verificar}"
            	update="formEsquerdo" />
            	
		</h:form>
	</div>
</ui:composition>
</html>